package Stream;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * @author chihb
 * @create-time 2024/7/9 6:50
 * @description
 */
public class Test5 {
    public static void main(String[] args) {
        List<String> man=new ArrayList<>();
        Collections.addAll(man,"蔡徐坤,24","野纤维,23","刘不甜,22","吴签,24","古嘉,30","小亮亮,27");
        List<String> woman=new ArrayList<>();
        Collections.addAll(woman,"赵晓燕,35","杨颖,36","高圆圆,43","张天天,31","刘诗,35","杨消弥,33");
        Stream<String> newMan = man.stream().filter(s -> s.split(",")[0].length() == 3).limit(2);
        Stream<String> newWonMan = woman.stream().filter(s -> s.split(",")[0].startsWith("杨")).skip(1);
        List<Actor> collect = Stream.concat(newMan, newWonMan)
                .map(s -> new Actor(s.split(",")[0], Integer.parseInt(s.split(",")[1])))
                .collect(Collectors.toList());
        System.out.println(collect);


    }
}
